package test;

import java.util.Random;

public class Th {
	
	public static void main(String[] args) {
<<<<<<< HEAD
/*		String s1=null;
		String s2="123";
=======
		String s1=null;
>>>>>>> 9cf79cd622363484742276c1324b9c391da58684
		
		String a=String.valueOf(s1);
		System.out.println(a.getClass());
		if("null"==a){
			System.out.println(111);
		}*/
		//System.out.println(randomString(-229985452) + " " + randomString(-147909649));
		System.out.println(randomString(-229985452) + " " + randomString(-2143977835));
		//randomInt("saf");
		Random random=null;
		//print("seed:"+test(random,"doubi",-247483648));
	}

	public static int test(Random random,String word,int init){
		Long start=System.currentTimeMillis();
		if(null==random){
			random=new Random(init);
		}

		while(true){
			init++;
			String str=returnWord(random,init);
			if(str.equals(word)){
				break;
			}
		}
		print("it spents:"+(System.currentTimeMillis()-start+"ms"));
		return  init;
	}


	public static String returnWord(Random random,int seed){
		random.setSeed(seed);
		StringBuilder sb = new StringBuilder();
		while (true){
			int k=random.nextInt(27);
			//System.out.println("char:" + k + ",number:" +  k);
			if(k==0)

				break;
			k+=96;
			sb.append((char)k);
		}
		return sb.toString();
	}

	public static String randomString(int i) {
		Random ran = new Random(i);
		StringBuilder sb = new StringBuilder();
		while (true) {
			int k = ran.nextInt(27);
			//System.out.println("char:" + k + ",number:" +  k);
			if (k == 0)
				break;
			k += 96;
			sb.append((char) k);
		}
		return sb.toString();
	}
	public static void print(Object str){
		System.out.println(str);
	}



}
